package com.letu.mq.selector;


import cn.hutool.core.collection.CollectionUtil;
import java.util.List;
import java.util.stream.Collectors;

/**
 * 单事件mq信息
 */
public class SelectorExpressionTopicOfBusiness {
    public static String queryStr(String mqSystem, List<String> list) {
        List<String> mqList = list.stream().filter(s -> s.indexOf(mqSystem + "_") > -1).collect(Collectors.toList());
        StringBuilder stringBuilder = new StringBuilder();
        if (CollectionUtil.isEmpty(mqList)) {
            return "";
        }
        mqList.stream().forEach(s -> stringBuilder.append(s).append("||"));
        return stringBuilder.toString().substring(0, stringBuilder.length() - 2);
    }
}
